package com.kvest.scanrecognizer.utility;

/**
 * Created with IntelliJ IDEA.
 * User: Kvest
 * Date: 03.11.13
 * Time: 22:04
 * To change this template use File | Settings | File Templates.
 */
public class FormatUtils {
    public static final int TXT_FORMAT = 0;
    public static final int DOC_FORMAT = 1;
    public static final int PDF_FORMAT = 2;

    public static final String TXT_FORMAT_NAME = "txt";
    public static final String DOC_FORMAT_NAME = "doc";
    public static final String PDF_FORMAT_NAME = "pdf";

    public static final String TXT_FORMAT_EXTENSION = ".txt";
    public static final String DOC_FORMAT_EXTENSION= ".doc";
    public static final String PDF_FORMAT_EXTENSION = ".pdf";

    public static String getExtentionById(int id) {
        switch (id) {
            case TXT_FORMAT : return TXT_FORMAT_EXTENSION;
            case DOC_FORMAT : return DOC_FORMAT_EXTENSION;
            case PDF_FORMAT : return PDF_FORMAT_EXTENSION;
            default: return TXT_FORMAT_EXTENSION;
        }
    }

    public static String getNameById(int id) {
        switch (id) {
            case TXT_FORMAT : return TXT_FORMAT_NAME;
            case DOC_FORMAT : return DOC_FORMAT_NAME;
            case PDF_FORMAT : return PDF_FORMAT_NAME;
            default: return TXT_FORMAT_NAME;
        }
    }
}
